<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script src="Observer.js"></script>
<script src="request.js"></script>

<script>

  function getResult(res) {
    // console.log(res);//表格
    // 剩余的操作只能在回调函数操作
    // 操作一旦是异步
  }

  request('./data.json', getResult);

</script>

<script>

  function success(res) {
    console.log(res);
    $observer.emit('get.lengthList.fail', '你错没错!!!');
  }

  $observer.on('get.lengthList.success', success);
  $observer.on('get.lengthList.fail', (err) => console.log(err));
</script>
</body>
</html>
